<template>
	<view>
		<view class="date">
			发布时间：{{detail.publishTime}}
		</view>
		<view class="title" style="margin-top: 30rpx;">
			{{detail.title}}
		</view>
		<view class="content" style="margin-top: 36rpx;">
			{{detail.content}}
		</view>
	</view>
</template>

<script>
	const app = getApp()
	export default {
		data() {
			return {
				detail:{
					"title":"",
					"publishTime":"2020-02-12 23:00:00",// 发布时间
					"isTop": 0, 						// 是否置顶 0：未置顶 1：置顶
					"content": "",						// 公告内容
				}
			}
		},
		methods: {
			
		},
		onLoad(opts) {
			uni.request({
				header:{
					Authorization: 'Bearer ' + app.globalData.token,
				},
				url: app.globalData.curl + 'bulletinBoard/detail/' + opts.id,
				method: 'GET',
				data: {},
				success: res => {
					const {data} = res
					if(data.code==200){
						console.log(data)
						this.detail=data.data
					}else if(data.code==500){
						uni.showToast({
							icon:'none',
							title: data.message
						});
					}
				},
				fail: (err) => {console.error(err)},
				complete: () => {}
			});
		}
	}
</script>

<style scoped>
	.date{
		
		font-size: 28rpx;
		font-family: Alibaba PuHuiTi;
		color: #666666;
		line-height: 36rpx;
	}
	
	.title{
		font-size: 34rpx;
		font-family: Alibaba PuHuiTi;
		font-weight: bold;
		color: #333333;
		line-height: 48rpx;
	}
	
	.content{
		font-size: 28rpx;
		font-family: Alibaba PuHuiTi;
		color: #333333;
		line-height: 48rpx;
	}
</style>
